package org.jianfa.learn.dubbo.main;

import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.extension.ExtensionLoader;
import org.jianfa.learn.dubbo.api.HelloService;

public class DubboAdaptiveApplication {

    public static void main(String[] args) {
        /**
         * hello.service代表了helloService接口
         * 场景1：test://localhost/hello?hello.service=human
         * 场景2：
         * 场景3：test://localhost/hello
         */
        URL url = URL.valueOf("test://localhost/hello?hello.service=human");
        HelloService adaptiveHelloService = ExtensionLoader.getExtensionLoader(HelloService.class).getAdaptiveExtension();
        String message = adaptiveHelloService.sayHello(url);
        System.out.println("message: " + message);
    }
}
